import {
  Controller,
  Get,
  Post,
  Body,
  Patch,
  Param,
  Delete,
  Version,
} from '@nestjs/common';
import { FffService } from './fff.service';
import { CreateFffDto } from './dto/create-fff.dto';
import { UpdateFffDto } from './dto/update-fff.dto';

@Controller({ path: 'fff', version: 'v1' })
export class FffController {
  constructor(private readonly fffService: FffService) {}

  @Post()
  create(@Body() createFffDto: CreateFffDto) {
    return this.fffService.create(createFffDto);
  }

  @Get()
  findAll() {
    return this.fffService.findAll();
  }

  @Version('v2')
  @Get()
  findAllV2() {
    return this.fffService.findAllV2();
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.fffService.findOne(+id);
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updateFffDto: UpdateFffDto) {
    return this.fffService.update(+id, updateFffDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.fffService.remove(+id);
  }
}
